cc.Class({
    extends: cc.Component,

    properties: {
        ground1: cc.Node,
        ground2: cc.Node,
        bg :  cc.Node,  
    },

    onLoad: function () {
        this.schedule(this.onGroundMove.bind(this),cc.myData.MOVE_INTERVAL);
     },



     onGroundMove:function(){
        this.ground1.x -= cc.myData.OFFSET_X;
        this.ground2.x -= cc.myData.OFFSET_X;
        if(this.ground1.x + this.ground1.width / 2 +  this.bg.width / 2 <= 0){
            this.ground1.x = this.ground1.width;
        }
        if(this.ground2.x + this.ground1.width / 2 +  this.bg.width / 2 <= 0){
            this.ground2.x = this.ground1.width;
        }

    },

    start(){},

     update(dt){
    
    },


   




});
